$OpenBSD: patch-config_configure_in,v 1.1 2014/10/31 08:19:39 dcoppa Exp $
--- config/configure.in.orig	Mon Mar 10 18:06:15 2014
+++ config/configure.in	Thu Mar 13 16:32:27 2014
@@ -1011,7 +1011,7 @@ if test "$GD" != "no"; then
       PNG_LDFLAGS=`$PNGLIBCONFIG --ldflags`
       LDFLAGS="$LDFLAGS $PNG_LDFLAGS"
     fi
-    AC_CHECK_LIB(png, png_create_read_struct , [LIBPNG=yes])
+    AC_CHECK_LIB(png, png_create_read_struct , [LIBPNG=yes],, -lz -lm)
 # restore variables
     LIBS=$SAVE_LIBS_PNG
     CFLAGS=$SAVE_CFLAGS_PNG
@@ -1040,7 +1040,7 @@ if test "$GD" != "no"; then
 	GD_PNG=yes
         GD_LIBS="$GD_LIBS $PNG_LIBS"
         AC_MSG_RESULT(yes)
-	AC_CHECK_LIB(png, png_access_version_number,[AC_DEFINE(HAVE_PNGVERSION, 1,)])
+	AC_CHECK_LIB(png, png_access_version_number,[AC_DEFINE(HAVE_PNGVERSION, 1,)],, -lz -lm)
         AC_DEFINE(HAVE_GD_PNG, 1, [Define to 1 if you have png support in libgd.])
       else
         AC_MSG_RESULT(no)
@@ -1501,7 +1501,7 @@ else
   MORE_TARGETS="$MORE_TARGETS $GUIS"
   AC_MSG_CHECKING(GToolbox.popup_menu args)
   GTOOLBOX="$OCAMLLIB/$LABLGTK_NAME/gToolbox.mli"
-  grep popup $GTOOLBOX | grep -i button 2> /dev/null && GTOOLBOX_ARGS=new
+  grep popup $GTOOLBOX | grep -i button >/dev/null 2>&1 && GTOOLBOX_ARGS=new
   if test "$GTOOLBOX_ARGS" = "new"; then
     GTOOLBOX_POPUPMENU=' ~button: button ~time: time '
     AC_MSG_RESULT(new)
